package cn.wusifx.zabbix.request.builder.user;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.RequestBuilder;

import java.util.HashMap;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/user/user.checkauthentication
 */
public class UserCheckAuthenticationRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private String sessionId;
    private Boolean extend = true;
    public UserCheckAuthenticationRequestBuilder() {
        super("user.checkAuthentication");
        baseRequest.setParams(new HashMap<>());
    }

    public UserCheckAuthenticationRequestBuilder(Long id) {
        super("user.checkAuthentication", id);
        baseRequest.setParams(new HashMap<>());
    }

    public Boolean getExtend() {
        return extend;
    }

    public UserCheckAuthenticationRequestBuilder setExtend(Boolean extend) {
        this.extend = extend;
        return this;
    }

    public String getSessionId() {
        return sessionId;
    }

    public UserCheckAuthenticationRequestBuilder setSessionId(String sessionId) {
        this.sessionId = sessionId;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("sessionid",sessionId);
        baseRequest.getParams().put("extend",extend);
        return baseRequest;
    }
}
